import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'
import { SharedModule } from '@shared'
import { NzAddOnModule } from 'ng-zorro-antd/core'

import { StoreRoutingModule } from './store-routing.module'
import { ChannelFormService } from './components/channel-form/channel-form.service'
import { FieldControlService } from './components/channel-form/field-control.service'
import { StoreService } from './store.service'
import { StoreAlinterService } from './store-alinter.service'
import { StoreDataService } from './store-data.service'
import { ChannelFormComponent } from './components/channel-form/channel-form.component'
import { ChannelFormFieldComponent } from './components/channel-form/channel-form-field.component'
import { StoreChannelComponent } from './detail/channel/channel.component'
import { StoreChannelCardComponent } from './components/store-channel-card/store-channel-card.component'
import { StoreDetailComponent } from './detail/detail.component'
import { StoreListComponent } from './list/list.component'
import { StoreNewComponent } from './new/new.component'
import { StoreNewBaseComponent } from './new/base/base.component'
import { StoreNewCardChannelComponent } from './new/card-channel/card-channel.component'
import { StoreNewQrcodeChannelComponent } from './new/qrcode-channel/qrcode-channel.component'
import { StoreNewEcChannelComponent } from './new/ec-channel/ec-channel.component'
import { StoreNewSystemComponent } from './new/system/system.component'
import { StoreNewSettlementComponent } from './new/settlement/settlement.component'
import { StoreNewUserComponent } from './new/user/user.component'
import { StoreNewCardFuncComponent } from './new/card-func/card-func.component'
import { StoreNewQrcodeFuncComponent } from './new/qrcode-func/qrcode-func.component'
import { StoreNewRiskControlComponent } from './new/risk-control/risk-control.component'
import { TabQRChannelsService } from './detail/tab-qr-channels/tab-qr-channels.service'
import { DashboardService } from '../dashboard/dashboard.abstract.service'
import { DashboardAlinterService } from '../dashboard/dashboard-alinter.service'
import { StoreDetailRouterGuardClass } from '@shared/classes/StoreDetailRouterGuardClass'
import { ChannelsSwitcherComponent } from './components/channels-switcher/channels-switcher.component'
import { StoreBaseChannelComponent } from './detail/channel/store-base-channel.component'
import { StoreOpenChannelComponent } from './detail/channel/store-open-channel.component'
import { StoreEditChannelComponent } from './detail/channel/store-edit-channel.component'
import { ChannelFormQRService } from './components/channel-form/channel-form-qr.service'
import { ChannelFormCardService } from './components/channel-form/channel-form-card.service'
import { TabCardChannelsService } from './detail/tab-card-channels/tab-card-channels.service'
import { ChannelFormECService } from './components/channel-form/channel-form-ec.service'
import { TabECChannelsService } from './detail/tab-ec-channels/tab-ec-channels.service'
import { QRCodeModule } from 'angularx-qrcode'
import { AcquirerAlinterService } from '../acquirer/acquirer-alinter.service'
import { AcquirerService } from '../acquirer/acquirer.service'
import { CombSettlementPeriodConfigComponent } from './new/settlement/combs/period-config/period-config.component'

const COMPONENTS = [
  StoreDetailComponent,
  StoreListComponent,
  StoreNewComponent,
  StoreChannelComponent,
  StoreChannelCardComponent,
  ChannelFormComponent,
  ChannelFormFieldComponent,
  ChannelsSwitcherComponent,
]

const COMPONENTS_NOROUNT = [
  StoreNewBaseComponent,
  StoreNewCardChannelComponent,
  StoreNewQrcodeChannelComponent,
  StoreNewEcChannelComponent,
  StoreNewSystemComponent,
  StoreNewSettlementComponent,
  StoreNewUserComponent,
  StoreNewCardFuncComponent,
  StoreNewQrcodeFuncComponent,
  StoreNewRiskControlComponent,
  StoreBaseChannelComponent,
  StoreOpenChannelComponent,
  StoreEditChannelComponent,
  CombSettlementPeriodConfigComponent,
]

@NgModule({
  imports: [SharedModule, StoreRoutingModule, NzAddOnModule, QRCodeModule],
  declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT],
  entryComponents: COMPONENTS_NOROUNT,
  providers: [
    { provide: StoreService, useClass: StoreAlinterService },
    { provide: DashboardService, useClass: DashboardAlinterService },
    { provide: AcquirerService, useClass: AcquirerAlinterService },
    ChannelFormService,
    ChannelFormCardService,
    ChannelFormQRService,
    ChannelFormECService,
    FieldControlService,
    StoreDataService,
    TabQRChannelsService,
    StoreDetailRouterGuardClass,
    TabCardChannelsService,
    TabECChannelsService,
  ],
})
export class StoreModule {}
